// 设置
import serviceGroup from '@/afterSales/router/async/modules/serviceGroup'
import customerConfig from './customer_config'
const route = {
  meta: {
    roles: ['setting_center'],
    title: '设置',
    icon: 'shezhi-weixuan',
    activeIcon: 'shezhi-xuanzhong',
    group: 'management'
  },
  path: '/setting_center',
  component: () => import(/* webpackChunkName: "main-index" */ '@views/index.vue'),
  redirect: '/setting_center/index',
  children: [
    {
      meta: {
        roles: ['setting_center']
      },
      path: 'index',
      name: 'Config',
      component: () => import(/* webpackChunkName: "config" */ '@/views/config/index.vue'),
      children: [
        // {
        //   path: 'account',
        //   name: 'Account',
        //   meta: {
        //     title: '账户设置'
        //   },
        //   component: () => import(/* webpackChunkName: "config" */ '@/views/config/account/index.vue')
        // },
        {
          path: 'user_management',
          name: 'Agent',
          meta: {
            title: '座席',
            group: 'organization',
            roles: ['user_management']
          },
          component: () => import(/* webpackChunkName: "agent" */ '@/views/config/agent/index.vue')
        },
        {
          path: 'skillGroup_management',
          name: 'Queue',
          meta: {
            title: '技能组',
            group: 'organization',
            roles: ['skillGroup_management']
          },
          component: () => import(/* webpackChunkName: "queue" */ '@/views/config/queue/index.vue')
        },
        ...serviceGroup,
        {
          path: 'role_management',
          name: 'Role',
          meta: {
            title: '角色',
            group: 'organization',
            roles: ['role_management']
          },
          component: () => import(/* webpackChunkName: "role" */ '@/views/config/role/index.vue')
        },
        {
          path: 'number_management',
          name: 'Number',
          meta: {
            title: '号码管理',
            group: 'call_center',
            roles: ['number_management']
          },
          component: () => import(/* webpackChunkName: "number" */ '@/views/config/number/index.vue')
        },
        {
          path: 'voice_navigation',
          name: 'Ivr',
          meta: {
            title: '语音导航',
            group: 'call_center',
            roles: ['voice_navigation']
          },
          component: () => import(/* webpackChunkName: "ivr" */ '@/views/config/ivr/index.vue')
        },
        {
          path: 'base_setting',
          name: 'Basic',
          meta: {
            title: '基本设置',
            group: 'call_center',
            roles: ['base_setting']
          },
          component: () => import(/* webpackChunkName: "basic" */ '@/views/config/basic/index.vue')
        },
        {
          path: 'channel_setting_multi',
          name: 'Channel',
          meta: {
            title: '网页',
            group: 'qdgl',
            roles: ['channel_setting_multi']
          },
          component: () => import(/* webpackChunkName: "channelPcAndWap" */ '@/views/config/webchat/channel/pcAndWap/index.vue')
        },
        {
          path: 'channel_setting_wechat',
          name: 'wechat',
          meta: {
            title: '微信公众号',
            group: 'qdgl',
            roles: ['channel_setting_wechat']
          },
          component: () => import(/* webpackChunkName: "wechat" */ '@/views/config/webchat/channel/wechat/index.vue')
        },
        {
          path: 'channel_setting_wechatApp',
          name: 'wechatApp',
          meta: {
            title: '微信小程序',
            group: 'qdgl',
            roles: ['channel_setting_wechatApp']
          },
          component: () => import(/* webpackChunkName: "wechatApp" */ '@/views/config/webchat/channel/wechatApp/index.vue')
        },
        {
          path: 'channel_setting_sdk',
          name: 'sdk',
          meta: {
            title: '移动SDK',
            group: 'qdgl',
            roles: ['channel_setting_sdk']
          },
          component: () => import(/* webpackChunkName: "wechatApp" */ '@/views/config/webchat/channel/sdk/index.vue')
        },
        {
          path: 'channel_setting_baiduBCP',
          name: 'baiduBCP',
          meta: {
            title: '百度营销',
            group: 'qdgl',
            roles: ['channel_setting_baiduBCP']
          },
          component: () => import(/* webpackChunkName: "baiduBCP" */ '@/views/config/webchat/channel/baiduBCP/index.vue')
        },
        {
          path: 'channel_setting_wechatService',
          name: 'wechatService',
          meta: {
            title: '微信客服',
            group: 'qdgl',
            roles: ['channel_setting_wxkf']
          },
          component: () => import(/* webpackChunkName: "wechatService" */ '@/views/config/webchat/channel/wechatService/index.vue')
        },
        {
          path: 'enterprise_wechat',
          name: 'sdk',
          meta: {
            title: '企业微信',
            group: 'qdgl',
            roles: ['enterprise_wechat']
          },
          component: () => import(/* webpackChunkName: "eprWechat" */ '@/views/config/webchat/channel/eprWechat/index.vue')
        },
        {
          path: 'channel_setting_process',
          name: 'Process',
          meta: {
            title: '流程管理',
            group: 'im_center',
            roles: ['channel_setting_process']
          },
          component: () => import(/* webpackChunkName: "process" */ '@/views/config/webchat/process/index.vue')
        },
        {
          title: '全局设置',
          path: 'globalSetting',
          name: 'WebchatGlobalSetting',
          meta: {
            title: '全局设置',
            group: 'im_center',
            roles: ['im_global_set']
          },
          component: () => import(/* webpackChunkName: "WebchatGlobalSetting" */ '@/views/config/webchat/globalSetting/index.vue')
        },
        ...customerConfig,
        {
          path: 'spare_parts',
          name: 'spareParts',
          meta: {
            title: '备件管理',
            group: 'after_sales',
            roles: ['spare_mgt_setting']
          },
          component: () => import(/* webpackChunkName: "noticeSetting" */ '@/afterSales/views/config/spare/index.vue')
        },
        {
          path: 'public_setting',
          name: 'publicSetting',
          meta: {
            title: '公众号配置',
            group: 'company_setting',
            roles: ['psc_enterprise_public_account_setting']
          },
          component: () => import(/* webpackChunkName: "mobildSetting" */ '@/afterSales/views/config/noPublic/index.vue')
        },
        {
          path: 'dockSettings',
          name: 'dockSettings',
          meta: {
            title: '对接配置',
            group: 'company_setting',
            roles: ['psc_enterprise_docking_setting']
          },
          component: () => import(/* webpackChunkName: "mobildSetting" */ '@/afterSales/views/config/dockSettings/index.vue')
        },
        {
          path: 'customer_template_setting/satisfactionNew',
          name: 'satisfactionNew',
          meta: {
            group: 'customer_setting',
            title: '满意度模版配置',
            roles: ['workorder_setting_satisfaction']
          },
          component: () => import(/* webpackChunkName: "customer-template-setting" */ '@/afterSales/views/config/satisfaction/index.vue')
        },
        {
          path: 'customer_template_setting/busSetting',
          name: 'CustomerTemplateSetting',
          meta: {
            group: 'customer_setting',
            title: '工单模型设置',
            roles: ['workorder_setting_model']
          },
          component: () => import(/* webpackChunkName: "customer-template-setting" */ '@/views/config/template/settingBack.vue')
        },
        {
          path: '/customer_template_setting/:businessId',
          redirect: '/customer_template_setting/:businessId/base',
          component: () => import(/* webpackChunkName: "serviceConfig" */ '@after/views/config/serviceConfig/index.vue'),
          children: [
            {
              path: 'base',
              component: () => import(/* webpackChunkName: "serviceConfig" */ '@after/views/config/serviceConfig/base/index.vue'),
              meta: { hidden: false }
            },
            {
              path: 'fields',
              component: () => import(/* webpackChunkName: "serviceConfig" */ '@after/views/config/serviceConfig/fieldConfig/index.vue'),
              meta: { hidden: false }
            },
            {
              path: 'workflow',
              component: () => import(/* webpackChunkName: "serviceConfig" */ '@after/views/config/serviceConfig/workFlow/index.vue'),
              meta: { hidden: false }
            },
            {
              path: 'extendConfig',
              component: () => import(/* webpackChunkName: "serviceConfig" */ '@after/views/config/serviceConfig/extendConfig/index.vue'),
              meta: { hidden: false }
            }
          ]
        },
        {
          path: 'customer_template_setting/setting',
          name: 'CustomerTemplateSetting',
          meta: {
            group: 'customer_setting',
            title: '模版设置',
            roles: ['customer_setting']
          },
          component: () => import(/* webpackChunkName: "customer-template-setting" */ '@/views/config/template/setting.vue')
        },
        {
          path: 'customer_template_setting/edit/:_id*',
          name: 'TemplateEdit',
          component: () => import(/* webpackChunkName: "customer-template-edit" */ '@/views/config/template/edit.vue')
        },
        {
          path: 'customer_template_setting/settingUserPermissions*',
          name: 'SettingUserPermissions',
          component: () => import(/* webpackChunkName: "setting-user-permissions" */ '@/views/config/template/permissions.vue')
        },
        {
          path: 'label',
          name: 'Label',
          component: () => import(/* webpackChunkName: "label" */ '@/views/config/label/index.vue')
        },
        {
          path: 'docking_setting',
          name: 'interface',
          meta: {
            title: '对接设置',
            group: 'system_setting',
            roles: ['docking_setting']
          },
          component: () => import(/* webpackChunkName: "interface" */ '@/views/config/interface/index.vue')
        },
        {
          path: 'work_time_setting',
          name: 'worktime',
          meta: {
            title: '工作时间设置',
            group: 'system_setting',
            roles: ['work_time_setting']
          },
          component: () => import(/* webpackChunkName: "worktime" */ '@/views/config/ivr/timeConfig/index.vue')
        },
        {
          path: 'notice_setting',
          name: 'noticeSetting',
          meta: {
            title: '公告管理',
            group: 'system_setting',
            roles: ['notice_management']
          },
          component: () => import(/* webpackChunkName: "noticeSetting" */ '@/views/config/notice/index.vue')
        },
        {
          path: 'mobile_setting',
          name: 'mobileSetting',
          meta: {
            title: '移动端配置',
            group: 'company_setting',
            roles: ['app_portal_setting']
          },
          component: () => import(/* webpackChunkName: "mobildSetting" */ '@/afterSales/views/config/mobile/index.vue')
        }
      ]
    }
  ]
}

export default route
